<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CapSense Middleware Library 3.0 (Alpha): Callbacks</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CapSense Middleware Library 3.0 (Alpha)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__capsense__callbacks.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Callbacks</div>  </div>
</div><!--header-->
<div class="contents">
<p>Callbacks allow the user to execute Custom code called from the CapSense middleware when an event occurs. </p>
<p>CapSense supports several callbacks.</p>
<table class="doxtable">
<tr>
<th># </th><th>Callback Name </th><th>Associated Register </th><th>Callback Function Prototype </th><th>Description  </th></tr>
<tr>
<td>1 </td><td>Start Sample </td><td>ptrSSCallback </td><td><a class="el" href="group__group__capsense__structures.html#ga908447ccc2720f31c861d9eb79ff75d2">cy_capsense_callback_t</a> </td><td>This is called before each sensor scan triggering. Such a callback can be used to implement user-specific use cases like changing scan parameters depending on whether a sensor is going to be scanned.  </td></tr>
<tr>
<td>2 </td><td>End Of Scan </td><td>ptrEOSCallback </td><td><a class="el" href="group__group__capsense__structures.html#ga908447ccc2720f31c861d9eb79ff75d2">cy_capsense_callback_t</a> </td><td>This is called after sensor scan completion and there is no other sensor in the queue to be scanned.  </td></tr>
<tr>
<td>3 </td><td>Tuner Send Callback </td><td>ptrTunerSendCallback </td><td><a class="el" href="group__group__capsense__structures.html#gabf58e6ce283cb73f9b8a398abf6bad17">cy_capsense_tuner_send_callback_t</a> </td><td>This is called by the <a class="el" href="group__group__capsense__high__level.html#ga0c613df550388c119fdab4e50341a6b4" title="Establishes synchronized operation between the CapSense Middleware and the CapSense Tuner tool...">Cy_CapSense_RunTuner()</a> function to establish synchronous communication with the Tuner tool.  </td></tr>
<tr>
<td>4 </td><td>Tuner Receive Callback </td><td>ptrTunerReceiveCallback </td><td><a class="el" href="group__group__capsense__structures.html#gade1f00c852892b0fc498c9a3b9d28594">cy_capsense_tuner_receive_callback_t</a> </td><td>This is called by the <a class="el" href="group__group__capsense__high__level.html#ga0c613df550388c119fdab4e50341a6b4" title="Establishes synchronized operation between the CapSense Middleware and the CapSense Tuner tool...">Cy_CapSense_RunTuner()</a> function to establish synchronous communication with the Tuner tool.  </td></tr>
<tr>
<td>5 </td><td>CapSense Data Structure Initialization Callback </td><td>ptrEODsInitCallback </td><td><a class="el" href="group__group__capsense__structures.html#gaeebeea548d4c2235b14aba63f1dd4bcf">cy_capsense_ds_init_callback_t</a> </td><td>This is called by the <a class="el" href="group__group__capsense__high__level.html#gade28f1f915ce6b97f13399074a819c0d" title="Initializes the CapSense firmware modules. ">Cy_CapSense_Enable()</a> function after CapSense Data Structure initialization complete and before launching the first initialization scan. Using this callback is not recommended. It is used only to implement only user's specific use cases (while changing the CapSense default configuration). The callback is available for Fifth Generation CapSense devices.  </td></tr>
</table>
<dl class="section note"><dt>Note</dt><dd>Callbacks 1 and 2 are called by the <a class="el" href="group__group__capsense__high__level.html#ga694cd350c85fcdc9dd1bc984a91d2c38" title="Implements interrupt service routine for CapSense Middleware. ">Cy_CapSense_InterruptHandler()</a> function and lengthen this function execution. Usually, <a class="el" href="group__group__capsense__high__level.html#ga694cd350c85fcdc9dd1bc984a91d2c38" title="Implements interrupt service routine for CapSense Middleware. ">Cy_CapSense_InterruptHandler()</a> is called inside the ISR. Then these callbacks also lengthen the ISR execution.</dd></dl>
<p>All callbacks can be registered by direct assignment of the function pointers to the corresponding CapSense Data Structure field after call of the <a class="el" href="group__group__capsense__high__level.html#ga19b3aa9e14a04b76188f917c0dc004f5" title="Captures HW blocks (one or more) for CapSense operations and configures them to the default state...">Cy_CapSense_Init()</a> function as follows:</p><ul>
<li>Fifth Generation CapSense devices: <code>context-&gt;ptrInternalContext-&gt;&lt;Associated Register&gt; = &amp;CallbackFunction;</code></li>
<li>Fourth Generation CapSense devices: <code>context-&gt;ptrCommonContext-&gt;&lt;Associated Register&gt; = &amp;CallbackFunction;</code></li>
</ul>
<p>Callbacks 1 and 2 can be registered / unregistered using the <a class="el" href="group__group__capsense__high__level.html#ga289c4fd495135399a9ad9897920836a7" title="Registers a ures&#39;s callback function. ">Cy_CapSense_RegisterCallback()</a> and <a class="el" href="group__group__capsense__high__level.html#gaf43b3cdfce7a3e8c0e5622f42e0a6319" title="This function unregisters a previously registered user&#39;s callback function in the CapSense middleware...">Cy_CapSense_UnRegisterCallback()</a> functions. </p>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>CapSense Middleware Library 3.0 (Alpha)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
